//
//  array.cpp
//  learnC++
//
//  Created by apple on 2018/5/25.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#include "array.hpp"


void test_array(){
    
    int arr[MAX_STUD] = {};//Initialize all elements to 0
    
    int array2[] = { 0, 1, 2, 3, 4 };
    
    printf("sizeof(array2) = %lu\n",sizeof(array2));
    int length = (sizeof(array2) / sizeof(array2[0]));
    
    test_arrPtr(array2);
                                        
    double array[3]; // allocate 3 doubles
    array[0] = 2.0;
    array[1] = 3.0;
    array[2] = 4.3;
    //cpp 中
    
    int students[3]{1,4,6};
    
    const int numberOfStudents(5);
    int testScores[numberOfStudents];
    testScores[2] = 76;
    
    int jjj[static_cast<int>(StudentNames::MAX_STUDENTS)]{};
}

void test_arrPtr(int arr[]){
    
    printf("test_arrPtr = %lu\n",sizeof(arr)/sizeof(arr[0]));
    
    
}

